package org.lgiavedoni.android.franq.util.general;

import org.lgiavedoni.android.franq.core.bean.WeatherCondition;
import org.lgiavedoni.android.franq.core.place.PlaceManager;
import org.lgiavedoni.android.franq.core.position.Position;
import org.lgiavedoni.android.franq.core.position.PositionManager;
import org.lgiavedoni.android.franq.service.phone.location.LocationService;

public class WeatherUtil {

	public static WeatherCondition getWeatherCondition() {
		Position p = PlaceManager.inst.getCurrentPlace();
		if (p == null || p.isUnknowLocation()) {
			p = PositionManager.inst.getCurrentPosition();
		}

		if (p == null || p.isUnknowLocation()) {
			p = LocationService.inst.getLocation();
		}

		if (p != null && !p.isUnknowLocation()) {
			return org.lgiavedoni.android.franq.util.googe.WeatherUtil.getWeather(p);
		}
		return null;
	}

}
